package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.Employee;
import cn.wolfcode.crm.domain.PayManage;
import cn.wolfcode.crm.mapper.PayManageMapper;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.service.IPayManageService;
import cn.wolfcode.crm.util.PageResult;
import org.apache.poi.hssf.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.Date;
import java.util.List;

@Service
public class PayManageServiceImpl implements IPayManageService {
    @Autowired
    private PayManageMapper payManageMapper;


    public PageResult query(QueryObject qo) {
        int total = payManageMapper.query4Count(qo);
        if (total > 0) {
            return new PageResult(total, payManageMapper.query4List(qo));
        }
        return new PageResult(total, Collections.EMPTY_LIST);
    }

    public void changState(Long id) {
        payManageMapper.changState(id);
    }


    public void deleteByPrimaryKey(Long id) {

        payManageMapper.deleteByPrimaryKey(id);
    }

    public void insert(PayManage record) {
        if (record.getId() != null) {

            payManageMapper.insert(record);
        }

    }

    public PayManage selectByPrimaryKey(Long id) {

        return payManageMapper.selectByPrimaryKey(id);
    }

    public List<PayManage> selectAll() {

        return payManageMapper.selectAll();
    }

    public void updateByPrimaryKey(PayManage record) {

        payManageMapper.updateByPrimaryKey(record);
    }
}
